#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui>
#include "serialconsole.h"
#include "serialport.h"
#include "serialthread.h"
#include "termprefs.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::MainWindow *ui;
    QVBoxLayout *mainLayout;

    QString     port;
    int         baud;

    QComboBox   cbPort;


private slots:
    void actionButtonOpenPort(bool enable);
    void actionButtonPreferences();
    void actionExit();
    void closeEvent(QCloseEvent *event);

private:
    SerialPort      *serialPort;
    SerialConsole   *serialConsole;
    SerialThread    *serialThread;

    TermPrefs       *termPrefs;
};

#endif // MAINWINDOW_H
